// 双向绑定 Object.defiendPropty Proxy

let input = doucumnet.getElementById('input')

let obj = {
    name: x
};

// get 需要return
Object.defineProperty(obj, "name", {
    set(value) {
        input.value = value;
    }
})
obj.name = "cc"


// 2 set(target,key,value) get(target,key)
const handler = {
    set(target, key, value) {
        input.value = value;
        return Reflect.set(target, key, value)
    }
}
let proxy = new Proxy(obj, handler)
proxy.name = "cc"